Skip to content

Switch to Python 3.13 #2163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 15, 2025
Merged

Switch to Python 3.13 #2163

merged 3 commits into from
Aug 15, 2025

Conversation

mathbunnyru
Copy link
Member

Describe your changes

Issue ticket if applicable

Checklist (especially for first-time contributors)

  • I have performed a self-review of my code
  • If it is a core feature, I have added thorough tests
  • I will try not to use force-push to make the review process easier for reviewers
  • I have updated the documentation for significant changes

@mathbunnyru
Copy link
Member Author

mathbunnyru commented Oct 23, 2024

I don't plan to merge this now, but let's see how many things are broken

@mathbunnyru
Copy link
Member Author

mathbunnyru commented Oct 23, 2024

We depend on updating mamba to v2:
#2147

#15 9.104 error    libmamba Could not solve for environment specs
#15 9.104     The following packages are incompatible
#15 9.104     ├─ mamba <2.0.0 is installable with the potential options

@mathbunnyru mathbunnyru added the tag:Upstream A problem with one of the upstream packages installed in the docker images label Oct 23, 2024
@mathbunnyru
Copy link
Member Author

If you are interested in making Python 3.13 work for these images, please help conda-forge to build missing packages, here is the current progress: https://conda-forge.org/status/migration/?name=python313

@mathbunnyru
Copy link
Member Author

Python 3.13.1 has been released, so we're waiting for the packages to be compatible with 3.13.
When tests pass, I will merge this, but I have no idea if it will be soon.

@mathbunnyru
Copy link
Member Author

mathbunnyru commented Feb 20, 2025

The upstream PR to build conda for python3.13 in conda-forge has been merged 🎉
conda-forge/conda-feedstock#258

Let's see if everything else builds now (or if something fails)

@mathbunnyru
Copy link
Member Author

mathbunnyru commented Feb 20, 2025

Ok, there are 3 upstream issues:

  1. TensorFlow doesn't support Python 3.13: It doesn't support on python3.13 tensorflow/tensorflow#78774
    It seems that no one answers when the support will be added, unfortunately.
  2. rpy2: Waiting for Rebuild for python 3.13 conda-forge/rpy2-feedstock#127, but more for rpy2 v3.5.17 conda-forge/rpy2-feedstock#128
  3. We install pinned version of pandas for spark-related images.
    v4.0.0-rc1 tag and GitHub release has been created, but no binaries are available on https://dlcdn.apache.org/spark/. This version already uses last pandas 2.2.3, which already works with python 3.13 in conda-forge.
    So, we're waiting for new binaries to become available.

@mathbunnyru
Copy link
Member Author

mathbunnyru commented May 24, 2025

spark is almost released, shouldn't be long: #2300

@mathbunnyru mathbunnyru force-pushed the python3.13 branch 2 times, most recently from 2063d5b to 8ab3d71 Compare May 30, 2025 08:14
@flaviomartins
Copy link

  1. rpy2: Waiting for Rebuild for python 3.13 conda-forge/rpy2-feedstock#127, but more for rpy2 v3.5.17 conda-forge/rpy2-feedstock#128

Rebuild for python 3.13 merged. See: conda-forge/rpy2-feedstock#132

@mathbunnyru
Copy link
Member Author

  1. rpy2: Waiting for Rebuild for python 3.13 conda-forge/rpy2-feedstock#127, but more for rpy2 v3.5.17 conda-forge/rpy2-feedstock#128

Rebuild for python 3.13 merged. See: conda-forge/rpy2-feedstock#132

Thanks @flaviomartins! Awesome work 🔥
I actually wanted to try it out on the weekend, but let me restart it now.

@mathbunnyru mathbunnyru reopened this Jul 30, 2025
@flaviomartins
Copy link

Thanks @flaviomartins! Awesome work 🔥 I actually wanted to try it out on the weekend, but let me restart it now.

The datascience image failed due to rpy2 requirements resolution. I uploaded a new build which seems to fix this conda-forge/rpy2-feedstock#137.

@mathbunnyru
Copy link
Member Author

Tensorflow is not yet capable with Python 3.13, but pip ens up downloading another version:
Downloading tensorflow_cpu-2.20.0rc0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.5 kB)

https://github.com/tensorflow/tensorflow/releases/tag/v2.20.0-rc0

I hope it will be soon released and we will easily merge this

@flaviomartins
Copy link

Tensorflow is not yet capable with Python 3.13, but pip ens up downloading another version: Downloading tensorflow_cpu-2.20.0rc0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.5 kB)

https://github.com/tensorflow/tensorflow/releases/tag/v2.20.0-rc0

I hope it will be soon released and we will easily merge this

I was also surprised by the tensorflow images build success. While we are talking about this yesterday they released an RC with wheels for Python 3.13 👍

@anrayliu
Copy link

anrayliu commented Aug 5, 2025

Ok, there are 3 upstream issues:

  1. TensorFlow doesn't support Python 3.13: It doesn't support on python3.13 tensorflow/tensorflow#78774
    It seems that no one answers when the support will be added, unfortunately.
  2. rpy2: Waiting for Rebuild for python 3.13 conda-forge/rpy2-feedstock#127, but more for rpy2 v3.5.17 conda-forge/rpy2-feedstock#128
  3. We install pinned version of pandas for spark-related images.
    v4.0.0-rc1 tag and GitHub release has been created, but no binaries are available on https://dlcdn.apache.org/spark/. This version already uses last pandas 2.2.3, which already works with python 3.13 in conda-forge.
    So, we're waiting for new binaries to become available.

Hello, I noticed that rpy2 ticket 127 and ticket 128 are both now closed. Are we just waiting for TensorFlow now?

@mathbunnyru
Copy link
Member Author

Ok, there are 3 upstream issues:

  1. TensorFlow doesn't support Python 3.13: It doesn't support on python3.13 tensorflow/tensorflow#78774
    It seems that no one answers when the support will be added, unfortunately.
  2. rpy2: Waiting for Rebuild for python 3.13 conda-forge/rpy2-feedstock#127, but more for rpy2 v3.5.17 conda-forge/rpy2-feedstock#128
  3. We install pinned version of pandas for spark-related images.
    v4.0.0-rc1 tag and GitHub release has been created, but no binaries are available on https://dlcdn.apache.org/spark/. This version already uses last pandas 2.2.3, which already works with python 3.13 in conda-forge.
    So, we're waiting for new binaries to become available.

Hello, I noticed that rpy2 ticket 127 and ticket 128 are both now closed. Are we just waiting for TensorFlow now?

Yes, please see the comments above

@anrayliu
Copy link

anrayliu commented Aug 6, 2025

Thanks for the quick reply. As a side note, how often do these Python upgrades happen (one month after each new version, only with major versions, every 2 months, etc)?

@mathbunnyru
Copy link
Member Author

Thanks for the quick reply. As a side note, how often do these Python upgrades happen (one month after each new version, only with major versions, every 2 months, etc)?

We update major python version (like this PR does from 3.12 to 3.13) per our policy: https://jupyter-docker-stacks.readthedocs.io/en/latest/maintaining/tasks.html#updating-python-version

Images are rebuilt weekly automatically, so when a new patch release is available on conda-forge, our images will start using it automatically

@flaviomartins
Copy link

TF 2.20 has been released see: https://github.com/tensorflow/tensorflow/releases/tag/v2.20.0

@mathbunnyru mathbunnyru reopened this Aug 15, 2025
@mathbunnyru
Copy link
Member Author

TF 2.20 has been released see: tensorflow/tensorflow@v2.20.0 (release)

Awesome, thanks for letting me know, I updated the changelog date and the list of old images.
When CI is green I will check release tensorflow is getting installed and will merge this.

@mathbunnyru mathbunnyru merged commit 45abbce into jupyter:main Aug 15, 2025
69 of 70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tag:Upstream A problem with one of the upstream packages installed in the docker images
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants